home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 34.zip / BS1 part 34 / FredFish PD 314.adf / Zc / zcsrc.lzh / IOLib / stdio / isatty.c < prev    next >
C/C++ Source or Header  |  1989-05-29  |  340b  |  22 lines

  1. #include <stdio.h>
  2. #include <fcntl.h>
  3. #include <errno.h>
  4.  
  5. extern struct _device *_devtab[];
  6.  
  7. int
  8. isatty(fd)
  9. unsigned int fd;
  10. {
  11.     extern long IsInteractive();
  12.     register struct _device *fp;
  13.  
  14.     fp = &((*_devtab)[fd]);
  15.     if ( fd >=OPEN_MAX || !fp->fileHandle ) {
  16.         errno = EBADF;
  17.         return -1;
  18.     }
  19.  
  20.     return ( IsInteractive(fp->fileHandle) != 0 );
  21. }
  22.